<html>

<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>个人信息</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="stylesheet" type="text/css" href="${staticpath}/front/dist/css/sm.css">
    <link rel="stylesheet" type="text/css" href="${staticpath}/front/dist/css/sm-extend.css">
    <link rel="stylesheet" type="text/css" href="${staticpath}/front/dist/css/layout.css">
    <link rel="stylesheet" type="text/css" href="${staticpath}/front/dist/css/base.css">
</head>
<body>
<div class="page-group">
    <div class="page page-current">
        <!--头部部分 !-->
        <header class="bar bar-nav">
            <a class="icon icon-left pull-left back" href="${basepath}/rest/front/user/toSubList"></a>

            <h1 class="title">个人信息</h1>
        </header>
        <div class="content account-content">
            <div class="card img-card sex-card">
                <div class="card-content">
                    <div class="list-block">
                        <ul>
                            <li>
                                <a href="#" class="item-link item-content">
                                    <div class="item-inner">
                                        <div class="item-title">头像</div>
                                        <div class="item-after head-item-after"></div>
                                    </div>
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="card sex-card">
                <div class="card-content">
                    <div class="list-block">
                        <ul>
                            <li>
                                <a href="#" class="item-link item-content">
                                    <div class="item-inner">
                                        <div class="item-title">昵称</div>
                                        <div class="item-after name-item-after"></div>
                                    </div>
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="card sex-card">
                <div class="card-content">
                    <div class="list-block">
                        <ul>
                            <li>
                                <a href="#" class="item-link item-content" id="sexBtn">
                                    <div class="item-inner">
                                        <div class="item-title">性别</div>
                                        <div class="item-after sex-item-after"></div>
                                    </div>
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="card sex-card" style="border: none;">
                <div class="card-content">
                    <div class="list-block">
                        <ul>
                            <li>
                                <a class="item-link item-content">
                                    <div class="item-inner">
                                        <div class="item-title">绑定手机</div>
                                        <div class="item-after phone-item-after"></div>
                                    </div>
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type='text/javascript' src='${staticpath}/front/dist/js/lib/zepto.js' charset='utf-8'></script>
<script>
    $.config = {
        router: false
    }
</script>
<script type='text/javascript' src='${staticpath}/front/dist/js/lib/sm.js' charset='utf-8'></script>
<script type='text/javascript' src='${staticpath}/front/dist/js/lib/sm-extend.js' charset='utf-8'></script>
<script>
    function getQueryString(name) {
        var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
        var r = window.location.search.substr(1).match(reg);
        if (r != null) {
            return unescape(r[2]);
        }
        return null;
    }
    var id = getQueryString("id");
    $.ajax({
        type: "GET",
        url: "/rest/front/user/selectDetail",
        data: {
            id: id
        },
        dataType: "json",
        success: function (data) {
            //查询头像
            var  imgHtml='<img src='+data.data.icon+'>';
            $(".head-item-after").html(imgHtml);
            //查询姓名
            $(".name-item-after").text(data.data.nickname);
            //查询性别
            if(data.data.sex=="1"){
                $(".sex-item-after").text("男");
            }else if(data.data.sex=="2"){
                $(".sex-item-after").text("女");
            }else {
                $(".sex-item-after").text("未知");
            };
            //查询手机号
            if(data.data.phone==""||data.data.phone==null){
                $(".phone-item-after").text("未绑定");
            }else{
                $(".phone-item-after").text(data.data.phone);
            }

        }
    });
    $.init();
</script>
</body>

</html>
